#pragma once

// Copyright (c) 2010 Manuel Peinado Gallego <manuel.peinado@gmail.com>
// Distributed under the MIT license

// MaterialEvent.h : interface of the MaterialEvent and MaterialListener classes
//

class Material;
class MaterialManager;

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


class MaterialEvent
{
public:
    
    enum Type
    {
        MaterialRemoved,
        MaterialAdded,
        MaterialPropertyChanged,
        OtherType
    };

    enum 
    {
        TextureLayerAdded   = 1,
        AmbientColor        = 2,
        DiffuseColor        = 4,
        SpecularColor       = 8,
        EmissionColor       = 16,
        Shininess           = 32,
        TextureLayerProperty = 64,
        OtherProperty       = 128
    };
    typedef int Property;

    MaterialEvent(Type type=OtherType, Property property_=OtherProperty)
        : type(type), property_(property_)
    {
    }

    MaterialManager* manager;
    Material* material;
    int type;
    int property_;
};


class MaterialListener 
{
public:
    virtual void onMaterialEvent(const MaterialEvent&) { }
};
